Abstract interface for unified communications with dynamic models

ABSTRACT

A device may include a first type of modeling environment, a second type of modeling environment, and an abstract interface. The first type of modeling environment may be associated with at least one of a first toolbox or a first function. The second type of modeling environment may include a model. The second type of modeling environment may be different than the first type of modeling environment and may be incompatible with the at least one of a first toolbox or a first function. The abstract interface may interface with the first type of modeling environment and the second type of modeling environment. The abstract interface may allow the at least one of a first toolbox or a first function to be used in the model in the second type of modeling environment.

RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.11/270,221, (Now U.S. Pat. No. 8,127,311) entitled “ABSTRACT INTERFACEFOR UNIFIED COMMUNICATIONS WITH DYNAMIC MODELS,” filed Nov. 9, 2005, theentire disclosure of which is incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates to modeling environments for dynamicsystems. More particularly, the present invention relates to interfacingwith models regardless of model type.

BACKGROUND OF THE INVENTION

Many organizations are embracing the paradigm of Model Based Developmentin their production processes. “Model Based Development” refers to thepractice of specifying, analyzing, and implementing systems using acommon “model” containing a set of block diagrams and associatedobjects. System implementation typically involves automaticallygenerating code for portions of the model, particularly portionscorresponding to the system's control algorithm.

Graphical modeling environments are an example of software applicationsthat may enable a user to model dynamic systems i.e., systems whoseoutputs change over time, using a graphical model, such as a blockdiagram. Some graphical modeling environments also enable simulation andanalysis of models. Simulating a dynamic system in a graphical modelingenvironment is typically a two-step process. First, a user creates agraphical model, such as a block diagram, of the system to be simulated.A graphical model may be created using a graphical user interface, suchas a graphical model editor. The graphical model depicts time-basedrelationships between the systems inputs, states, parameters andoutputs. After creation of the graphical model, the behavior of thedynamic system over a specified time period is simulated using theinformation entered into the graphical model. In this step, thegraphical model is used to compute and trace the temporal evolution ofthe dynamic systems' outputs (“execute the graphical model”), andautomatically produce either deployable software systems or descriptionsof hardware systems that mimic the behavior of either the entire modelor portions of the model (code generation).

Dynamic systems may also be modeled textually. In this methodology,dynamic systems are described in an application specific language orcode. Using this textual description, the dynamic system may besimulated and analyzed. Simulating a dynamic system in a textualmodeling environment is typically a two-step process. First, a usercreates a textual model, such as an M-file or LTI model, of the systemto be simulated. A textual model may be created using a textual userinterface, such as a textual model editor. The textual model depictstime-based relationships between the systems inputs, states, parametersand outputs. After creation of the textual model, the behavior of thedynamic system over a specified time period is simulated using theinformation entered into the textual model. In this step, the textualmodel is used to compute and trace the temporal evolution of the dynamicsystems' outputs (“execute the graphical model”), and automaticallyproduce either deployable software systems or descriptions of hardwaresystems that mimic the behavior of either the entire model or portionsof the model (code generation).

There are many different techniques for modeling systems using differentmodeling environments. One problem with this is that a model created inone modeling environment may not be compatible with another modelingenvironment. As such, toolboxes possessing tools and functions ofinterest for use with a model may not be compatible with the modelingenvironment the model was created in. Thus what is need is a simpleconvenient way of interfacing a model regardless of model type.

SUMMARY OF THE INVENTION

According to one aspect, a device may include a first type of modelingenvironment, a second type of modeling environment, and an abstractinterface. The first type of modeling environment may be associated withat least one of a first toolbox or a first function. The second type ofmodeling environment may include a model. The second type of modelingenvironment may be different than the first type of modeling environmentand may be incompatible with the at least one of a first toolbox or afirst function. The abstract interface may interface with the first typeof modeling environment and the second type of modeling environment. Theabstract interface may allow the at least one of a first toolbox or afirst function to be used in the model in the second type of modelingenvironment.

According to another aspect, a method may be implemented by one or morecomputing devices. The method may include receiving, via an abstractinterface that is configured to interface with a first type of modelingenvironment and a second type of modeling environment, a call from afirst toolbox to a model in the second type of modeling environment. Thecall may use at least one function that may be compatible with the firsttype of modeling environment and may be incompatible with the secondtype of modeling environment. The method may also include allowing, viathe abstract interface, the at least one function from the first toolboxto be implemented in the model in the second type of modelingenvironment; placing, via the abstract interface, the call to the modelin the second type of modeling environment; and receiving data from themodel in the second type of modeling environment in response to placingthe call to the model and the at least one function being implemented inthe model.

According to a further aspect, a computer-readable medium may storeinstructions executable by at least one processor to perform a method.The computer-readable medium may include one or more instructions forreceiving an abstract interface from a remote device, the abstractinterface being configured to interface with a first type of modelingenvironment and a second type of modeling environment; one or moreinstructions for receiving, via the abstract interface, a call from afirst toolbox to a model in the second type of modeling environment, thecall using at least one function that is compatible with the first typeof modeling environment and incompatible with the second type ofmodeling environment; one or more instructions for allowing, via theabstract interface, the at least one function from the first toolbox tobe implemented in the model in the second type of modeling environment;and one or more instructions for placing the call to the model.

According to still another aspect, a system may include means forreceiving a call to a model in a first type of modeling environment. Thecall may use at least one function that is compatible with a second typeof modeling environment and incompatible with the first type of modelingenvironment. The at least one function may cause one or more propertiesto be obtained from the model, cause the model to be simulated and aresponse to be returned, cause at least one Jacobian associated with themodel to be obtained, or cause the model to be at least one of trimmedor linearized. The system may further include means for allowing the atleast one function to be implemented in the model in the first type ofmodeling environment and means for placing the call to the model.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 illustrates an environment suitable for practicing anillustrative embodiment of the present invention.

FIG. 2 is an exemplary Mass-Spring-Damper system to be modeled.

FIG. 3 is an exemplary graphical model of the Mass-Spring-Damper systemof FIG. 2.

FIG. 4 is an exemplary flowchart of a method of interfacing a model of adynamic system using an abstract interface.

FIG. 5 is an example diagram of how the abstract interface providescommunication between models and toolboxes.

FIG. 6 is an exemplary hierarchical diagram showing the interrelation ofdifferent object classes used to implement the abstract interface.

FIG. 7 illustrates a client-server environment suitable for practicingan illustrative embodiment of the present invention.

DETAILED DESCRIPTION OF AN ILLUSTRATIVE EMBODIMENT

An illustrative embodiment of the present invention is directed tocreating a universal object class representation of a model which can beinterfaced by a number of modeling environments. The present inventionwill be described relative to illustrative embodiments. Those skilled inthe art will appreciate that the present invention may be implemented ina number of different applications and embodiments and is notspecifically limited in its application to the particular embodimentsdepicted herein.

FIG. 1 depicts an environment suitable for practicing an illustrativeembodiment of the present invention. A computing device 2 includesmemory 4, on which software according to one embodiment of the presentinvention is stored, one or more processors (CPU) 7 for executingsoftware stored in the memory, and other programs for controlling systemhardware. Such processors can have one or more cores allowing formultiple instances of software to run simultaneously on the processor.The use of multiple processors, multiple cores, or both allow forgreater computational functionality as multiple applications orprocesses can be run concurrently on the computing device.

Typically, the interaction of a human user with the computing device 2occurs through an input/output (I/O) device 8, such as a graphical userinterface (GUI). The I/O device 8 may include a display device 8 a (suchas a monitor) and an input device (such as a mouse 8 b and a keyboard 8c and other suitable conventional I/O peripherals.

For example, the memory 4 holds a modeling application 6 capable ofcreating and simulating digital versions of system models, such as blockdiagrams, state diagrams, signal diagrams, flow chart diagrams, sequencediagrams, UML diagrams, dataflow diagrams, circuit diagrams, ladderlogic diagrams, kinematic element diagrams, or other models, which maybe displayed to a user 10 via the display device 8 a. In theillustrative embodiment, the modeling application 6 comprises a MATLABmodeling environment, such as Simulink® or another suitable modelingenvironment. As used herein, the terms “modeling environment” and“physical modeling environment” refer to an application where a model,such as a model of a physical system, is created and translated intoexecutable instructions. Examples of suitable modeling applicationsinclude, but are not limited to MATLAB, including Simulink,SimMechanics, and SimDriveline from the MathWorks, Inc.; LabVIEW,DasyLab and DiaDem from National Instruments Corporation, VEE fromAgilent, SoftWIRE from Measurement Computing, VisSim from VisualSolutions, SystemVIEW from Elanix, WiT from Coreco, Vision ProgramManager from PPT Vision, Khoros from Khoral Research, and numerousothers. The memory 4 may comprise any suitable installation medium,e.g., a CD-ROM, floppy disks, or tape device; a computer system memoryor random access memory such as DRAM, SRAM, EDO RAM, Rambus RAM, etc.;or a non-volatile memory such as a magnetic media, e.g., a hard drive,or optical storage. The memory may comprise other types of memory aswell, or combinations thereof.

In an alternate embodiment, the computing device 2 is also interfacedwith a network, such as the Internet. Those skilled in the art willrecognize that the diagrams used by the diagramming application 6 may bestored either locally on the computing device 2 or at a remote location9 interfaced with the computing device over a network. Similarly, thediagramming application 6 may be stored on a networked server or aremote peer.

The modeling application 6 of an illustrative embodiment of theinvention includes a number of generic components. Although thediscussion contained herein focuses on MATLAB from The MathWorks, Inc.of, Natick Mass., those skilled in the art will recognize that theinvention is applicable to other software applications. The genericcomponents of the illustrative diagramming program 6 include a modeleditor 6 a for specifying models of dynamic systems. The model editor 6a allows users to perform such actions as construct, edit, display,annotate, save, and print out a model that represents a physical system.The illustrative diagramming application 6 also includes elementslibraries 6 b that contain elements that may be combined to modelsystems. There may also be a graphical aspect 6 c that allows graphicalmodeling. An execution engine 6 d, also implemented in the application,is used to process a model to produce simulation results or to convertthe model to executable code. The execution engine 6 d translates amodel to executable entities. The executable entities are compiled andexecuted on a computational device, such as a computer, to implement thefunctionality specified by the model. Typically, the code generationpreserves a model hierarchy in a call graph of the generated code. Forinstance, each subsystem of a model in a physical modeling environmentcan map to a user specified function and the generated code. Real-TimeWorkshop from the MathWorks, Inc. of Natick, Mass. is an example of asuitable execution engine 6 d for generating code.

In the illustrative embodiment, the modeling program 6 is implemented asa companion program to a technical computing program, such as MATLAB,also available from the MathWorks, Inc.

The model editor 6 a is the component that allows a user to create andmodify a model representing a physical system. The model editor 6 a alsoallows a user to create and store data relating to model element 6 b. Atextual interface with a set of commands allows interaction with themodel editor. Using this textual interface, users may write specialscripts that perform automatic editing operations on the model. A usergenerally interacts with a set of windows that act as canvases for themodel. There is generally more than one window for a model becausemodels may be partitioned into multiple hierarchical levels through theuse of subsystems.

Once a model has been constructed using the editor 6 a, the executionengine 6 d simulates the model by solving equations defined by the modelto trace the system outputs as a function of time. The solution of themodel, which may be referred to as model execution, is carried out overa user-specified time span for a set of user-specified inputs.

FIG. 2 is a depiction of a Mass-Spring-Damper system 200 to be modeledusing a modeling environment. The equations of motion for this systemcan be written as

$\overset{.}{x}\overset{.}{=}{\begin{bmatrix}{d\; 1} \\{d\; 1} \\{d\; 2} \\{d\; 2}\end{bmatrix} = {{\begin{bmatrix}0 & 1 & 0 & 0 \\{- \frac{k\; 1}{m\; 1}} & {- \frac{b\; 1}{m\; 1}} & \frac{k\; 1}{m\; 1} & \frac{b\; 1}{m\; 1} \\0 & 0 & 0 & 1 \\\frac{k\; 1}{m\; 2} & \frac{b\; 1}{m\; 2} & {- \frac{{k\; 1} + {k\; 2}}{m\; 2}} & {- \frac{{b\; 1} + {b\; 2}}{m\; 2}}\end{bmatrix}x} + {\begin{bmatrix}0 \\{- \frac{1}{m1}} \\0 \\0\end{bmatrix}F}}}$ $y = {{\begin{bmatrix}1 & 0 & 0 & 0 \\0 & 0 & 1 & 0\end{bmatrix}x} + {\lbrack 0\rbrack F}}$The default parameter values are m=[1,2] kg, k=[100,200] N/m, and b=[10,20] Ns/m.

These model equations can be implemented in an M-file to be solved. Suchan M-file may contain code as shown below.

function [dx,y] = mds_model_ode (t,x,u,p1,p2,p3) % M-file ODE model ofthe mass-spring-damper system. % % dx: Output equations %  y: Stateequations % % t: Current time % x: State vector at time t % u: Inputvector at time t % p1,..., pn: Model parameters m = p1; k = p2; b = p3;A = [0, 1, 0, 0;   −k(1)/m(1), −b(1)/m(1), k(1)/m(1), b(1)/m(1);   0, 0,0, 1;   k(1)/m(2), b(1)/m(2), −(k(1)+k(2))/m(2), −(b(1)+b(2))/m(2)]; B =[0; −1/m(1); 0; 0]; C = [1 0 0 0; 0 0 1 0]; D = 0; dx = A*x + B*u; y =C*x + D*u;

The Mass-Spring-Damper system of FIG. 2 can also be modeled in agraphical modeling environment such as Simulink. An example of such asystem can be seen in the block diagram 300 of FIG. 3.

Alternatively to the M-file or Simulink models, the system of FIG. 2 canbe modeled as linear time-invariant (LTI) object. Such a LTI object canbe created using the following commands:

Function G = msd_model_lti( ) % LTI model of the mass-spring-dampersystem. m = [1 2]; k = [100 200]; b = [10 20]; A = [0, 1, 0, 0; −k(1)/m(1), −b(1)/m(1), k(1)/m(1), b(1)/m(1);  0, 0, 0, 1;  k(1)/m(2),b(1)/m(2), −(k(1)+k(2))/m(2), −(b(1)+b(2))/m(2)]; B = [0; −1/m(1); 0;0]; C = [1 0 0 0; 0 0 1 0]; D = 0; G = ss(A, B, C, D); set (G,‘InputName’,  ‘F’,...   ‘OutputName’ {‘d1’ ‘d2’},...   ‘StateName’, {‘Position 1’, ‘Velocity 1’, ‘Position 2’, ‘Velocity 2’})

As can be seen from the above examples, there are several ways to modela system. One of the problems with there being multiple techniques isthat they are not necessarily compatible. As such, toolboxes possessingtools and functions of interest may be compatible with one model but notanother. For example, Simulink Parameter Estimation (SPE), SimulinkResponse Optimization (SRO), and Simulation Control Design (SCD)toolboxes can only be used with Simulink models. Likewise the ControlSystem Toolbox (CST) can only be used with LTI models. This presents aproblem, in that it may be desirable to use the features of a toolbox ona model the toolbox is not compatible with. Ideally, it would beadvantageous to be able to interface a model, such as from a toolbox,regardless of how the model was created.

FIG. 4 depicts a flow chart 400 of one embodiment of interfacing a modelin a modeling environment regardless of model type. The first step isproviding an abstract interface for interfacing a model wherein theabstract interface is compatible with a plurality of model types 410.Next, a call is made to a dynamic model using functions or methodsspecified in the abstract interface 420 and supported by the underlyingdynamic model. Data is then received from the dynamic model in responseto the call 430. Each of these steps will be discussed in more detailbelow.

The abstract interface allows for a model to be interfaced regardless ofhow it was generated. For each model type the implementation for thefunctions that interface with the toolbox are provided. As such, atoolbox or modeling environment can access any type of model. An exampleof this can be seen in the diagram 500 of FIG. 5. As depicted in thisdiagram 500, various model types 510 can be interface with a toolbox 520using the abstract interface 530. In certain instances, a static modelcan also be interface for optimization and statistical analysis 540.

In certain embodiments, the abstract interface is an applicationprogramming interface (API). An API is a set of definitions of the waysone piece of computer software communicates with another. The APIprovides a set of routines, protocols, and tools for allowingcommunication between the software applications, for example the modeland toolbox. Using these routines, protocols and tools the toolbox ormodeling environment can interface with the model.

In one embodiment, the abstract interface is implemented using a modelobject class. The model class defines an interface for communicatingwith various types of models that can be created in MATLAB, includingSimulink models, SimBiology models, and ODEs defined in M-functions.Toolboxes can communicate with the models through the model classinterface, allowing the implementation of other model types.

The model class defines the properties for objects representing models.For example the class can define properties that are common forrepresentations of all model types. These include field details,constructor details, and method details.

Field details include the version of the model. Other field details maybe provided as necessary for specific models. Other suitable fielddetails will be apparent to one skilled in the art given the benefit ofthis disclosure.

Constructor details set forth the call made by the abstract interface tocreate a model object. Examples of constructor details will be givenbelow in reference to specific model types. Other suitable constructordetails will be apparent to one skilled in the art given the benefit ofthis disclosure.

Method details include the methods functions and calls that are to besupported by an instantiated model object. A list of example methodsthat are to be implemented for all model types can be seen below:

getName: Returns the name of the model.   name = m.getName;getInputs/findInput: Used to extract input port information from themodel.   hIn = m. getInputs; % All inputs   hIn = m. getInputs([2 3]); %Multiple inputs by indices   hIn = m.findInput(‘u’) ; % One input byname getOuputs/findOutputs: Used to extract output port information fromthe model.   hOut = m.getOutputs; % All outputs   hOut = m.getOutputs([12]); % Multiple outputs by indices   hOut =m.findOutput(‘subsysteml/Outl’) ; % One output by namegetParameters/findParameter: Used to extract parameter information fromthe model.   hPar = m.getParameters; % All parameters   hPar =m.getParameters([2 4 7]); % Multiple parameters by indices   hPar =m.findParameter(‘Ka’); % One parameter by name   hPar = m. findParameter(‘reaction: Kl’) ; % One parameter by namegetStates/findState: Used to extract state information from the model.  hIc = m.getStates; % All states   hIc = m.getStates([1 3 5]); %Multiple states by indices   hIc = m.findState(‘sensor/xl’); % One stateby name getValue: Used to get the current parameter and/or initial statevalues in the model.   sVal = m.getValue(‘Actuator Model’); % Get statevalue object by name   % Equivalent to:   sId = m.findState(‘ActuatorModel’);   sVal= m.getValue(sId);   pId  = m.getParameters;   sId  =m.getStates([2 4]);   pVal = m. getValue (pId) ; % Get parameter valueobjects   hVal = m.getValue([pId; sId]); % Get parameter/state valueobjects setValue: Used to set the parameter and/or initial state valuesin the model.   m.setValue(‘Actuator Model’, 2.5); % Set state value byname   % Equivalent to:   sId = m.findState(‘Actuator Model’);  m.setValue(sId, 2.5);   hVal = m.getValue(sId);   hVal.Value = 2.5;  m. setValue (hVal) ; % Set using value objects   pId =m.getParameters(2);   sId = m.getStates([2 4]);   m.setValue(pId, 1.0);% Set parameter value   m.setValue([pId; sld], {1.0, 0.05, 0.0}); % Setparameter/state values addOutput: Adds one or more outputs to the model.  hOut = m. addOutput(‘u’); % One output by name   hOut =m.addOutput(hPorts); % From specified port objects removeOutput: Removesone or more outputs from the model.   m.removeOutput(‘Nz Pilot’); % Oneoutput by name   % Equivalent to:   hOut = m.find0utput(‘NZ Pilot’);  m.removeOutput(hOut);   m.remove Out put; % All outputs  m.removeOutput (hPorts); % Specified output ports   m.removeOutput ([12]); % Multiple outputs by indicesgetLinearizationIOs/findLinearizationIO: Used to extract linearizationI/O port information from the model.   hLin = m.getLinearizationIOs; %All linearization ports   hLin = m.getLinearizationIOs([1 2]); %Multiple lin. ports by indices   hLin =m.findLinearizationIO(‘subsys/In1’); % One linearization port by nameaddLinearizationIO: Adds one or more linearization I/Os to the model.  hLin = m. addLinear izationIO (hPorts) ; % From specified lin. portobjects   hLin = m.addLinearizationIO(‘u’); % One linearization port byname removeLinearizationIO: Removes one or more linearization I/Os fromthe model,   m.removeLinearizationIO; % All linearization ports   m.removeLinearizationIO(hPorts) ; % Specified linearization ports  m.removeLinearizationIO([1 2]); % Multiple lin. ports by indices  m.removeLinearizationIO(‘Nz Pilot’); % One linearization port by namegetCurrentConfig: Returns the current model configuration object (set).  config = m.getCurrentConfig; setCurrentConfig: Sets the current modelconfiguration object (set).   m.setCurrentConfig(config); simulate:Returns the time response of the system for the (optionally) specifiedoutputs.   [outputs, info] = m.simulate(timespan, inputs, options);getSensitivity: Gets the sensitivity derivatives of the system for the(optionally) specified outputs with respect to a given parameter orinitial state.   [derivs, info] = m.getSensitivity(timespan, inputs,variable, options);   [IResp, rResp, info] = m.getSensitivity(timespan,inputs, variable, options); findOperatingPoint: Finds the operatingpoint (steady-state) of the model from operating point specifications orby simulation at the given times.   [op_point, op_report] =m.findOperatingPoint(op_spec, linoptions);   op_points =m.findOperatingPoint(snapshottimes, linoptions); linearize: Linearizethe model at the given operating point for (if) specified linearizationI/O ports.   G = m.linearize(op.point, linearizationios, linoptions);  G = m.linearize(snapshottimes, linearizationios, linoptions); update:Synchronizes the concrete Model object when the underlying modelchanges.   m.update;

The model class can also be extended for specific model types. Forexample, the model class may be extended to a MLModel class. The MLModelclass defines a concrete interface for communication with models definedin either M-Files or Mex-files. Mex-files are used to implement modelequation in compiled code such as Fortran or C. The MLModel class hasall the properties of the model class plus some additional propertiesset forth below.

Field Details

ModelFcn: Function handle to the M-file or MEX-file representing themodel.

IOPorts: Object array of type MLPortID containing information about theI/Os of the model.

LinearizationPorts: Object array of type MLLinearizationPortIDcontaining information about the linearization I/Os of the model.

Parameters: Object array of type MLParameterID containing informationabout the parameters of the model.

States: Object array of type MLStateID containing information about thestates of the model.

ParameterValues: Object array of type ParameterValue storing currentparameter values.

InitialState: Object array of type StateValue storing initial statevalues.

ConfigSet: Object containing various simulation settings for the model.

Constructor Details—the syntax to create a Matlab model object is

-   -   h=modelpack.MLModel(@mfile, Nin, Nout, Nstates, ‘param1’,        value1, . . . );    -   h=modelpack.MLModel(@mfile, {‘in1’, . . . }, {‘out1’, . . . },        {‘state1’ . . . }, . . . ‘param1’, value1, . . . );    -   h=modelpack.MLModel(Omfile, Nin, {‘out1’, . . . }, Nstates, . .        . ); % Mixed        Method Details

addParameter: Adds one or more parameters to the model.

pId = m.addParameter(‘name’, value); % One parameter by name pId =m.addParameter % Multiple parameters ({‘name1’, ‘name2’}, {1.0,0.05});

removeParameter: Removes one or more parameters from the model.

m.removeParameter(‘name’;) ; % One parameter by name % Equivalent to:pld = m f indParameter(‘name’) ; m.removeParameter(pId);m.removeParameter; % All parameters m.removeParameter(pId) ; % Specifiedparameters m.removeParameter([1 2]); % Multiple parameters by indices

The hierarchy of the model class 610 to other classes, including subclasses 620 such as the MLModel class, can be seen in FIG. 6. Otherpossible subclasses extended from the model class will be apparent toone skilled in the art given the benefit of this disclosure.

In some embodiments, the abstract interface is further implemented usingan identifier object class. As with the model class, the identifier(VariableID) class can define properties that are common forrepresentations of all model types. These include field details,constructor details, and method details.

In this example, there are three main subclasses of the identifierclass. These include the port identifier class (PortID), the parameteridentifier class (ParameterID), and the state identifier class(StateID). Each of these share the common properties of the Variable IDclass plus additional properties.

The port identifier class (PortID) is an abstract class that defines aninterface for objects representing the concept of inputs and outputs ofa model. The inputs are the points where signals are injected into amodel; and the outputs are the points where signals of interest aremeasured and logged. These also include signals marked as linearizationI/Os. The classes derived from the PortID class need to implement theoperations defined by the interface and are used by the Model objects toidentify their inputs and outputs to interested client objects. In thecontext of parameter estimation, the operations defined by the interfaceprovide a mapping between the inputs and outputs of a model and theexperimental data that is associated with them during estimations. Forexample, each object storing transient data in SPE will keep a referenceto an object derived from the PortID class to do this mapping.

An example of the properties for the PortID class can be seen below:

Field Details:

Description: A description string.

Version: The version number used by subclasses to handle backwardcompatibility issues in conjunction with their loadobj and saveobjmethods.

Method Details:

getDimensions: Returns a row vector of integer numbers corresponding tothe dimensions of the signal at the port.

-   -   dims=h.getDimensions;

There are three types of possible values:

-   -   (1) Return 1 for a scalar signal.    -   (2) Return n for a vector signal of size n.    -   (3) Return [m, n] for a matrix-valued signal of size [ra, n].    -   Note that a vector signal of size n is not the same as        matrix-valued signals of size [n, 1] or [1, n].

getFullName: Returns the unique full name of the port. The full name ofa port usually consists of a concatenation of its path and name; and ituniquely identifies the port in the model.

-   -   fullname=h.getFullName;

getName: Returns the name of the port.

-   -   name=h.getName;

getPath: Returns the path to the port, which is usually the full name ofthe (sub) system containing the port.

-   -   path=h.getPath;

get Type: Returns the port type, which is an enumerated string of typeModel_IOType.

-   -   % type==‘Input’, ‘Output’    -   type=h.getType;

As with the model class, the port identifier class (portID) can also beextended for specific model types. The hierarchy of the portID class 640to the VariableID 630 and other classes can be seen in FIG. 6. Otherpossible subclasses 645 extended from the PortID class will be apparentto one skilled in the art given the benefit of this disclosure.

In certain embodiments a linearization I/O class is used in conjunctionwith the PortID classes to denote the linearization I/Os in a model.Examples of the pertinent properties are set forth below:

Method Details:

is OpenLoop: Returns the open-loop status of the signal marked as alinearization I/O.

-   -   flag=h.isOpenLoop;

setOpenLoop: Sets the open-loop status of the signal marked as alinearization I/O.

-   -   h.setOpenLoop(true);

set Type: Sets the linearization I/O type to an enumerated string oftype Model_IOType.

-   -   % type==‘Input’, ‘Output’, ‘InOut’, ‘OutIn’    -   h.setType(‘InOut’)

The interrelation of the Linerization I/O class 650 to subclasses 655and other classes can be seen in FIG. 6. Other possible embodiments willbe apparent to one skilled in the art given the benefit of thisdisclosure.

The parameter identifier class (ParameterID) defines an interface forobjects representing the concept of parameters of a model. The classesderived from the ParameterID class need to implement the operationsdefined by the interface and are used by the Model objects to identifytheir parameters to interested client objects. In the context ofparameter estimation, the operations defined by the interface provide amapping between the parameters of a model and the objects working withparameter values during estimations. For example, each objectrepresenting estimated parameters in SPE will store a reference to anobject derived from the ParameterID class to avoid redundant storage ofparameter information.

An example of the properties for the ParameterID class can be seenbelow:

Field Details:

Description: A description string.

Version: The version number used by subclasses to handle backwardcompatibility issues in con junction with their loadobj and saveobjmethods.

Method Details:

getDimensions: Returns a row vector of integer numbers corresponding tothe dimensions of the parameter value.

-   -   dims=h.getDimensions;

getFullName: Returns the unique full name of the parameter.

-   -   fullname=h.getFullName;

getName: Returns the name of the parameter.

-   -   name=h.getName;

getPath: Returns the path to the parameter, which is usually the fullname of the (sub)system in which the parameter is defined.

-   -   path=h.getPath;

getClass: Returns the class of the parameter value.

-   -   type=h.getClass;

getLocations: Returns a cell array of the full names of the objects(model, subsystems, blocks, etc.) using the parameter. If no otherinformation is available, the string from getPath could be returned in acell array. The location names are all relative to the model, and hencethey do not include the model name.

-   -   names=h.getLocations;

As with the port identifier class (portID), the parameter identifierclass (ParameterID) can also be extended for specific model types. Thehierarchy of the ParameterID class 660 to other classes can be seen inFIG. 6. Other possible subclasses 665 extended from the ParameterIDclass will be apparent to one skilled in the art given the benefit ofthis disclosure.

The state identifier class (StateID) defines an interface for objectsrepresenting the concept of states of a model. The classes derived fromthe StateID class need to implement the operations defined by theinterface and are used by the Model objects to identify their states tointerested client objects. In the context of parameter estimation, theoperations defined by the interface provide a mapping between the statesof a model and the objects working with state values during estimations.For example, each object representing estimated states or initial statedata in SPE will store a reference to an object derived from the StateIDclass to do this mapping.

An example of the properties for the State ID class can be seen below:

Field Details:

Description: A description string.

Version: The version number used by subclasses to handle backwardcompatibility issues in conjunction with their loadobj and saveobjmethods.

Method Details;

getDimensions: Returns a row vector of integer numbers corresponding tothe dimensions of the state value.

-   -   dims=h.getDimensions; Note that this method call should be        equivalent to calling size on the state vector.

getFullName: Returns the unique name of the state.

-   -   fullname=h.getFullName;

getName: Returns the name of the state.

-   -   name=h.getName;

getPath: Returns the path to the state, which is usually the full nameof the (sub)system in which the state is defined.

-   -   path=h.getPath;

getTs: Returns the sampling time of the state.

-   -   Ts=h.getTs;

As with the port identifier class (portID), the state identifier class(StateID) can also be extended for specific model types. The hierarchyof the StateID class 670 to other classes can be seen in FIG. 6. Otherpossible subclasses 675 extended from the StateID class will be apparentto one skilled in the art given the benefit of this disclosure.

In some embodiments, the abstract interface is further implemented usinga value object class. As with the model and identifier classes, thevalue class can define properties that are common for representations ofall model types. These include field details, constructor details, andmethod details.

In this example, there are four main types of the value class. Theseinclude a variable value class, a parameter value class, a state valueclass, and port value class. For purposes of illustration the discussionwill focus on the variable value class. The implementation of the otherclasses will be apparent to one skilled in the art given the benefit ofthis disclosure.

The variable value (VariableValue) class defines an interface torepresent the concept of value of an object identified by a Variable IDobject. The classes derived from the VariableValue class need toimplement the operations defined by the interface and are used by theModel objects to identify values of parameters, states, and ports tointerested client objects. The value objects are used to store thevalues of I/Os, parameters, or states resulting from estimation, tuning,or trimming the model. They can also be used to initialize modelparameters and initial states. Hence, most of their properties arepublic since they would be modified by the users.

An example of the properties for the VariableValue class can be seenbelow:

Field Details:

ID: The VariableID object associated with this object.

Version: The version number used by subclasses to handle backwardcompatibility issues in conjunction with their loadobj and saveobjmethods.

Name: The name of the associated object.

Value: The value of the associated object.

Description: A description string.

Constructor Details.

The classes ParameterValue, StateValue, and PortValue implement theVariableValue interface:

h0 = modelpack.ParameterValue(m, % Name and ‘path/name(expr) ’);expression h0 = modelpack.ParameterValue(m, pld, ‘expr’); % ID objecth1=modelpack.ParameterValue(m, ‘k’);% Equivalent top=m.findParameter(‘k’)h1=modelpack.ParameterValue(m, p);s=m.getStates(2);h2=modelpack.StateValue(m, s);in=m.getInputs(3);h3=modelpack.PortValue(m, in);Method Details:

getID: Returns the identifier of type VariableID associated with thisobject.

-   -   hID=h.getID;

The hierarchy of the variable value class 710, the parameter value class720, the state value class 730, and port value class 740 can be seen inFIG. 6.

In some embodiments, the abstract interface is further implemented usinga specification object class. As with the model and value classes, thespecification class can define properties that are common forrepresentations of all model types. These include field details,constructor details, and method details.

In this example, there are four main types of the specification class.These include a variable specification class, a parameter specificationclass, a state specification class, and port specification class. Forpurposes of illustration the discussion will focus on the variablespecification class. The implementation of the other classes will beapparent to one skilled in the art given the benefit of this disclosure.

The variable specification (VariableSpec) class defines an interface torepresent the concept of value specification for an object identified bya VariableID object. The specifications include the variable's range andinitial value. These are used to specify information about unknownvalues to be computed (i.e. estimated, optimized, and trimmed). Theclasses derived from the VariableSpec class need to implement theoperations defined by the interface and are used by the Model objects tospecify values of parameters, states, and ports to interested clientobjects. The specification objects are used to specify I/O, parameter,or state information (ranges, initial guesses, etc) for estimation,tuning, or operating point computations. Hence, most of their propertiesare public since they would be modified by the users.

An example of the properties for the VariableSpec class can be seenbelow:

Field Details.

ID: The VariableID object associated with this object.

Version: The version number used by subclasses to handle backwardcompatibility issues in conjunction with their loadobj and saveobjmethods.

Name: The name of the associated object.

Initial Value: The initial value of the associated object.

Minimum: The minimum value of the associated object.

Maximum: The maximum value of the associated object.

Known: The optimization state of the associated object.

TypicalValue: The typical value of the associated object.

Description: A description string.

Constructor Details.

The classes ParameterSpec, StateSpec, and PortSpec implement theVariableSpec interface:

h0 = modelpack.ParameterSpec(m, % Name and ‘path/name(expr) ’);expression h0 = modelpack.ParameterSpec (m, pld, ‘expr’); % ID objecth1=modelpack.ParameterSpec (m, ‘k’);% Equivalent top=m.findParameter(‘k’)h1=modelpack.ParameterSpec (m, p);s=m.getStates(2);h2=modelpack.StateSpec (m, s);in=m.getInputs(3);h3=modelpack.PortSpec (m, in);Method Details:

getID: Returns the identifier of type VariableID associated with thisobject.

-   -   hID=h.getID;

The hierarchy of the variable specification class 750, the parameterspecification class 760, a state specification class 770, and portspecification class 780 can be seen in FIG. 6.

In some embodiments, the abstract interface is further implemented usinga helper object class. As with the other classes discussed above, thehelper class can define properties that are common for representationsof all model types. These include field details, constructor details,and method details.

In this example, there are two main types of the helper class. Theseinclude a model manager class and an options class. The implementationof the other classes will be apparent to one skilled in the art giventhe benefit of this disclosure.

The model manager (ModelManager) class defines a singleton object tomanage various model objects to avoid duplications. Basically, eachmodel object is a singleton for a given model name.

An example of the properties for the ModelManager class can be seenbelow:

Field Details:

Models: Stores model object handles currently in use.

ModelListeners: Stores listeners to remove the model object handles fromthe model list when they are deleted.

Listeners: Internal listeners for the object's own use.

Constructor Details. The syntax to create a model manager object is:

-   -   M=modelpack.ModelManager;        However, this constructor is not directly called by the users,        but by the developers implementing Model subclasses.        Method Details In order to guarantee that there is only one        model object per model, the following code fragment should be        implemented in the Model subclass constructors:

this = modelpack.MyModelClass; %... % Ask the model manager if the modelexists h = addModeK modelpack.ModelManager, this, ‘name’ ); if (this ==h)  % New model. Initialize it.  % ... else  % Model already exists. this = h end % Return ‘this’

In this example the option class has two types: simoptions andgradoptions. The simoptions and gradoptions classes are used to specifyvarious simulation and sensitivity computation options in conjunctionwith method object method calls.

An example of the properties for the simoptions class can be seen below

Field Details. The simoptions object has the following properties:

Configuration: Configuration set.

InitialState: An array of State Value objects.

Outputs: An array of Port ID objects indicatings the outputs for whichthe responses are desired.

Description: A description string.

Version: The version number used by subclasses to handle backwardcompatibility issues in conjunction with their loadobj and saveobjmethods.

Constructor Details. The syntax to create options objects are:

-   -   h=modelpack.simoptions(m);

The gradoptions class is a subclass of the simoptions class. As such ishas the same base properties as simoptions plus the following:

Field Details.

GradientType: The gradient computation accuracy, which is an enumeratedstring

Perurbation: Minimum and maximum perturbation sizes used in sensitivitycomputations.

Constructor Details:

h=modelpack.gradoptions(m);

The hierarchy of the ModelManagaer class 680, the simoptions class 690,and gradoptions class 695 can be seen in FIG. 6.

Referring now back to FIG. 4, the second step of the method is making acall to the dynamic model via methods specified in the abstractinterface. The call may be any of methods supported by the objectclasses set forth above. Using the abstract interface, calls can be usedto query the model about its properties such as its inputs, parameters,etc.; simulate the model and gather its response; obtain various modeljacobians; and trim and linearize the model.

An example of calls and operations performed for an M-file model can beseen below:

% Create model object model = modelpack.MLModel(@msd_model_ode, 1, 2, 4,...          ‘m’, [1 2], ‘k’, [100 200], ‘b’, [10 20]); % or model =modelpack.MLModel(@msd_model_ode, {‘F’}, {‘d1’, ‘d2’}, ...         {‘Pos 1’, ‘Vel 1’, ‘Pos 2’, ‘Vel 2’}, ...          ‘m’ ,  [ 1 2] ,  ‘k’ ,  [100 200],  ‘b’ ,  [10 20]); % Set initial values s =model.getStates; model.setValues(s, {1 0 1 0}); % Simulate ts1 =model.simulate(time, force); % Compute sensitivity ts2 =model.getSensitivity(time, force, ‘k’); % Operating points op_point =model.findOperatingPoint(1.0); % Linearization pin = model.getInputs;pOut = model.getOutputs; model.addLinearizationIO([pIn pOut]) G =model.linearize(op.point); step(G);

In this example a model object was created and initial values were set.Then the model was simulated, sensitivity was computed, and operatingpoints determined. Then the model was linearized.

The examples to this point have focused primarily on the system wherethe graphical modeling environment was on a local computing device. Thegraphical modeling environment may, of course, also be implemented on anetwork 800, as illustrated in FIG. 7, having a server 804 and a clientdevice 802. Other devices, such as a storage device 806, may also beconnected to the network.

In one such embodiment a system for generating and displaying agraphical modeling application, comprises a distribution server forproviding to a client device, intrinsic units of measure for modelingphysical systems; and a client device in communication with thedistribution server. Here the distribution server provides a clientdevice, such as a computing device discussed above, an abstractinterface for interfacing a model. The abstract interface is compatiblewith a plurality of model types. The abstract interface may be an API.The client may then use the abstract interface to access a dynamic modelof a system.

In another embodiment, the server may execute the modeling environment.A user may then interact with the modeling environment on the serverthrough the client device. In one example of such a system, a server andclient device are provided. The server is capable of executing amodeling environment. The client device is in communication with theserver over a network. An abstract interface is provided for interfacinga model. The abstract interface is compatible with a plurality of modeltypes. The server receives from the client device, a call to a dynamicmodel using the abstract interface. The client device then receives datafrom the dynamic model from the server in response to the call.

It will be understood by one skilled in the art that these networkembodiments are exemplary and that the functionality may be divided upin any number of ways over a network.

The proceeding examples have focused primarily on models of physicalsystems but it will be apparent to one skilled in the art that there arenumerous other domains, systems, fields and applications the presentinvention would be suitable. Some examples include but are not limitedto, models in the electrical, biological, and chemical domains.

The present invention has been described relative to illustrativeembodiments. Since certain changes may be made in the aboveconstructions without departing from the scope of the invention, it isintended that all matter contained in the above description or shown inthe accompanying drawings be interpreted as illustrative and not in alimiting sense.

It is also to be understood that the following claims are to cover allgeneric and specific features of the invention described herein, and allstatements of the scope of the invention which, as a matter of language,might be said to fall therebetween.

1. A device comprising: a processor for providing: a first type ofmodeling environment for simulating or executing models, the first typeof modeling environment being associated with at least one of: a firsttoolbox or a first function; a second type of modeling environment forsimulating or executing models, the second type of modeling environment:including a first model, the first model having a type, being differentthan the first type of modeling environment, and being incompatible withthe at least one of a the first toolbox or a the first function; and anabstract interface, the abstract interface: providing a plurality ofimplementations of functions of the abstract interface, the plurality ofimplementations of the functions interfacing with the first toolbox, theplurality of implementations corresponding to a plurality of modeltypes, interfacing with the first type of modeling environment and thesecond type of modeling environment, allowing the at least one of thefirst toolbox or the first function to interact with the first model inthe second type of modeling environment using one of the implementationsof the functions of the abstract interface that corresponds to the typeof the first model, and being implemented using a helper object class,the helper object class defining at least one of a model manager classthat defines at least one object for managing a model object or anoptions class that defines one or more of a simulation option or asensitivity computation option.
 2. The device of claim 1 wherein theabstract interface specifies one or more application programminginterfaces (APIs) that aid the abstract interface in allowing the atleast one of the first toolbox or the first function to be used in thefirst model in the second type of modeling environment.
 3. The device ofclaim 1 wherein the first type of modeling environment includes at leastone of a text-based modeling environment, a graphical modelingenvironment, or a linear time-invariant (LTI) object environment and thesecond type of modeling environment includes a different one of atext-based modeling environment, a graphical modeling environment, or anLTI object environment.
 4. The device of claim 1 wherein the abstractinterface is implemented using a model object class, the model objectclass being associated with at least one of a field detail that includesa version of the first model, a constructor detail that defines a callto be made by the abstract interface to create a model object, or aconstructor detail that defines a call to be supported by the modelobject.
 5. The device of claim 1 wherein the abstract interface isimplemented using an identifier object class, the identifier objectclass being associated with at least one of a port identifier class thatdefines information relating to inputs and outputs of the first model, aparameter identifier class that defines information relating toparameters of the first model, or a state identifier class that definesinformation relating to states of the first model.
 6. The device ofclaim 1 wherein the abstract interface is implemented using a valueobject class, the value object class defining at least one value for oneor more of a variable, a parameter, a state, or a port for the firstmodel.
 7. The device of claim 1 wherein the abstract interface isimplemented using a specification object class, the specification objectclass defining at least one of a range or an initial value for at leastone of a variable, a parameter, a state, or a port for the first model.8. The device of claim 1 wherein the abstract interface is furtherconfigured to at least one of: obtain properties about the first modelin the second type of modeling environment, obtain one or more modelJacobians, or trim and linearize the first model.
 9. The system of claim1, wherein the processor further represents the first model as a modelobject of a model class, the model class describing methods supported byan instantiated model object, the first toolbox or the first functioninteracting with the first model through a call to one of the methods ofthe model class.
 10. A method, implemented by one or more computingdevices, comprising: receiving, via an abstract interface that isconfigured to interface with a first type of modeling environment and asecond type of modeling environment for executing or simulating models,a call from a first toolbox to a first model in the second type ofmodeling environment, the first model having a type, the call using atleast one function that is compatible with the first type of modelingenvironment and incompatible with the second type of modelingenvironment, the abstract interface being implemented using a helperobject class, the helper object class defining at least one of a modelmanager class that defines at least one object for managing a modelobject or an options class that defines one or more of a simulationoption or a sensitivity computation option; providing, with the abstractinterface, a plurality of implementations of functions of the abstractinterface, the plurality of implementations of the functions interfacingwith the first toolbox, the implementations corresponding to a pluralityof model types; allowing, via the abstract interface, the at least onefunction from the first toolbox to be implemented in the first model inthe second type of modeling environment using one of the implementationsof the functions of the abstract interface that corresponds to the typeof the first model; placing, via the abstract interface, the call to thefirst model in the second type of modeling environment; and receivingdata from the first model in the second type of modeling environmentafter placing the call to the first model, where the at least onefunction interacts with the first model.
 11. The method of claim 10wherein the abstract interface specifies one or more applicationprogramming interfaces (APIs) that allow the at least one function fromthe first toolbox to be implemented in the first model in the secondtype of modeling environment.
 12. The method of claim 10 wherein thefirst type of modeling environment includes at least one of a text-basedmodeling environment, a graphical modeling environment, or a lineartime-invariant (LTI) object environment and the second type of modelingenvironment includes a different one of a text-based modelingenvironment, a graphical modeling environment, or an LTI objectenvironment.
 13. The method of claim 10 wherein the at least onefunction causes one or more properties to be obtained from the firstmodel, and wherein the received data includes the one or moreproperties.
 14. The method of claim 13 wherein the one or moreproperties include an input or a parameter associated with the firstmodel.
 15. The method of claim 10 wherein the at least one functioncauses the first model to be simulated and a response to be returned,and wherein the received data includes the response.
 16. The method ofclaim 10 wherein the at least one function causes at least one Jacobianassociated with the first model to be obtained, and wherein the receiveddata includes the Jacobian.
 17. The method of claim 10 wherein the atleast one function includes a function that causes the first model to beat least one of trimmed or linearized.
 18. A non-transitorycomputer-readable medium that stores instructions executable by at leastone processor to perform a method, the computer-readable mediumcomprising: one or more instructions for receiving an abstract interfacefrom a remote device, the abstract interface being: configured tointerface with a first type of modeling environment and a second type ofmodeling environment for simulating or executing models, and implementedusing a helper object class, the helper object class defining at leastone of a model manager class that defines at least one object formanaging a model object or an options class that defines one or more ofa simulation option or a sensitivity computation option; one or moreinstructions for receiving, via the abstract interface, a call from afirst toolbox to a first model in the second type of modelingenvironment, the first model having a type, the call using at least onefunction that is compatible with the first type of modeling environmentand incompatible with the second type of modeling environment; one ormore instructions for providing, with the abstract interface, aplurality of implementations of functions of the abstract interface, theplurality of implementations of the functions interfacing with the firsttoolbox, the implementations corresponding to a plurality of modeltypes; one or more instructions for allowing, via the abstractinterface, the at least one function from the first toolbox to interactwith the first model in the second type of modeling environment usingone of the implementations of the functions of the abstract interfacethat corresponds to the type of the first model; and one or moreinstructions for placing the call to the first model.
 19. Thenon-transitory computer-readable medium of claim 18 further comprising:one or more instructions for receiving data from the first model in thesecond type of modeling environment in response to placing the call tothe first model and the at least one function being implemented in thefirst model.
 20. The non-transitory computer-readable medium of claim 18wherein the first type of modeling environment includes at least one ofa text-based modeling environment, a graphical modeling environment, ora linear time-invariant (LTI) object environment and the second type ofmodeling environment includes a different one of a text-based modelingenvironment, a graphical modeling environment, or an LTI objectenvironment.
 21. The non-transitory computer-readable medium of claim 18wherein the at least one function causes one or more properties to beobtained from the first model, causes the first model to be simulatedand a response to be returned, causes at least one Jacobian associatedwith the first model to be obtained, or causes the first model to be atleast one of trimmed or linearized.
 22. A system comprising: means forreceiving a call to a first model in a first type of modelingenvironment for simulating or executing models, the first model having atype, wherein the call uses at least one function that is compatiblewith a second type of modeling environment for simulating or executingmodels and incompatible with the first type of modeling environment, andthe at least one function: causes one or more properties to be obtainedfrom the first model, causes the first model to be simulated and aresponse to be returned, causes at least one Jacobian associated withthe first model to be obtained, or causes the first model to be at leastone of trimmed or linearized; means for providing a plurality ofimplementations of functions of an abstract interface that interfacewith the first toolbox, the implementations corresponding to a pluralityof model types, the abstract interface being implemented using a helperobject class, the helper object class defining at least one of a modelmanager class that defines at least one object for managing a modelobject or an options class that defines one or more of a simulationoption or a sensitivity computation option; means for allowing the atleast one function to interact with the first model in the first type ofmodeling environment using one of the implementations of the functionsof the abstract interface that corresponds to the type of the firstmodel; and means for placing the call to the first model.
 23. The systemof claim 22 further comprising: means for receiving data in response tothe call being placed to the first model and the at least one functionbeing implemented in the first model.